<template>
	<view class="" style="width: 100vw;height: 100vh">
	<!-- <view style="min-height: 100vh"> -->
	<view class="content" :style="{'background':kbackgroundColor}" style="min-height: 100vh">
	
		<!-- <image class="bg" src="/static/login/log_bg.png" mode="scaleToFill"></image> -->
		<hx-navbar title="分裂" :back="true" :fixed="false" :color="knavTitleColor" barPlaceholder="hidden" transparent="auto"></hx-navbar>
		<view class="container">
			<view class="compound_item" @tap="see_detail(item.id)" v-for="item,id in list" :key="id">
				<image :src="item.image" class="compound_img" mode="aspectFill"></image>
				<view class="info_box">
					<view class="info_text">
						{{item.name}}
					</view>
					<view class="info_time">
						<text>
							截止时间: {{item.end_time}}
						</text>
					</view>
					<view class="jindu">
						<!-- <image src="/static/index/btn_bg_medium.png" mode="scaleToFill" class="btn_bg"></image> -->
						<view class="jindu_text" style="">
							可分裂成 <text class="color-o">{{item.num}}</text> 个版权
						</view>
					</view>
				</view>
			</view>
	
			<!-- 
			<view class="com_item" @tap="see_detail(item.id)" v-for="item,id in list" :key="id">
				<image :src="item.image" mode="aspectFill" class="com_img"></image>
				<view class="jindu">
					<view class="jindu_bg">

					</view>
					<text style="position: relative;z-index: 10;">
						合成进度<text class="yellow">{{item.count}}</text>/{{item.hecheng_num}}
					</text>
				</view>
				<view class="com_info">
					<view class="com_name">
						{{item.name}}
					</view>
					
					<view class="com_time">
						截止时间: {{item.endtime}}
					</view>
				</view>
			</view>
 -->

		</view>  <view style="text-align: center;" v-if="list.length == 0">
			 <image src="@/static/without.png" style="width:550rpx;margin: 10rpx auto " alt="" mode="widthFix"></image> 
		</view>
	</view>
</view>
</template>
<script>
	export default {
		data() {
			return {
				list: [],
				page: 1,
				limit: 10,
				hasNextPage: true,
			}
		},
		onLoad(options) {
			this.get_data_list()
		},	
		onPullDownRefresh() {
					setTimeout(function() {
						uni.stopPullDownRefresh()
					}, 500)
			},
		onReachBottom() {
			let new_page = this.page + 1;
			let data = {
				page: new_page,
				limit: this.limit
			}
			this.$api.split(data, res => {
				if (res.status) {
					this.list = this.list.concat(res.data);
					this.hasNextPage = res.data.length >= this.limit;
					this.page = new_page
				}
			})
		},
		methods: {
			get_data_list: function() {
				let data = {
					page: this.page,
					limit: this.limit
				}
				this.$api.split(data, res => {
					if (res.status) {
						this.list = res.data;
						this.hasNextPage = res.data.length >= this.limit;
					}
				})
			},
			see_detail: function(id) {
				uni.navigateTo({
					url: '/pages/user/split/split_page?id=' + id
				})
			}
		}
	}
</script>

<style>
	.com_time {
		font-size: 24rpx;
		font-weight: 400;


		color: #333333;
		padding-top: 10rpx;
		padding-bottom: 40rpx;

	}

	.com_time2 {
		color: #F2D7AA;
		font-size: 24rpx;
		font-weight: 400;
		padding-top: 10rpx;
	}

	.icon_3d {
		width: 33rpx;
		height: 33rpx;
	}

	.com_name {
		display: flex;
		align-items: center;
		justify-content: space-between;
		font-size: 28rpx;
		font-weight: 400;

		color: #000000;
		line-height: 41rpx;
	}

	.com_info {
		padding: 16rpx;
	}

	.yellow {
		color: #6FEFEC;
	}

	.jindu_text {
		position: relative;
		font-size: 28rpx;
		z-index: 10;
		color: #000;
	}

	.jindu {
		display: flex;
		align-items: center;
		font-size: 20rpx;
		color: #fff;
		margin-top: 10rpx;

	}

	.jindu_bg {
		position: absolute;
		top: 0;
		left: 0;
	}



	.btn_bg {
		position: absolute;
		width: 100%;
		height: 100%;
		top: 0;
		left: 0;

	}


	.com_img {
		width: 100%;
		height: 335rpx;
		border-radius: 20rpx;

	}

	.com_item {
		width: 335rpx;
		height: 484rpx;
		position: relative;
		margin-bottom: 40rpx;
		background: #FFFFFF;
		box-shadow: 0rpx 5rpx 20rpx 1rpx rgba(0, 0, 0, 0.05);
		border-radius: 10rpx 10rpx 10rpx 10rpx;
	}

	.mart_goods_bg {
		position: absolute;
		bottom: 0;
		left: 0;
		width: 315rpx;
		height: 188rpx;

	}


	.container {
		width: 100%;
		padding: 20rpx;
		position: relative;
		z-index: 10;
		display: flex;
		justify-content: space-between;
		flex-wrap: wrap;
	}

	page {
		background-color: #fff;
	}
</style>

<style lang="scss" scoped>
	.num {
		color: #F4E1BC;
	}

	.info_time {
		width: 100%;
		font-size: 24rpx;
		color: #999;
		margin: 10rpx 0 20rpx;
	}

	.info_text {
		line-height: 50rpx;
		font-size: 32rpx;
		font-weight: bold;
		color: #000;
	}

	.info_box {
		flex: 1;
		padding-left: 20rpx;
	}

	.compound_img {
		width: 220rpx;
		height: 220rpx;
		border-radius: 20rpx;
	}

	.compound_item {
		width: 100%;
		height: 260rpx;
		background: $bg-box;
		border-radius: 20rpx;
		display: flex;
		align-items: center;
		padding: 20rpx;
		position: relative;
		margin-bottom: 20rpx;
	}

	page {}
</style>